package com.sanji.sjmallmanager.datamanager;

import com.sanji.sjmallmodule.goods.GoodsPartsItemBean;
import com.sanji.sjmallmodule.goods.GoodsTypeBean;
import com.sanji.sjmallmodule.goods.SearchTypeBean;
import com.sanji.sjmallmodule.login.RegisterRegionBean;

import java.util.ArrayList;
import java.util.List;

/**
 * /**
 * Created by fhm on 2016/12/27.
 * 统一管理静态数据
 */

public class SelectDataManager {
    public SelectDataManager() {
        super();
    }

    /*****
     * 分类页跳转后的筛选条件
     *****/
    public static List<RegisterRegionBean> getSelectFilter() {
        List<RegisterRegionBean> listPwData = new ArrayList<>();
        //可以自己定义一个id
//        listPwData.add(new RegisterRegionBean("综合排序"));
        listPwData.add(new RegisterRegionBean("价格从低到高"));
        listPwData.add(new RegisterRegionBean("价格从高到低"));
        listPwData.add(new RegisterRegionBean("新品优先"));
//        listPwData.add(new RegisterRegionBean("销量优先"));
        return listPwData;
    }

    /**
     * 得到配件类型
     */
    public static List<GoodsTypeBean> getGoodsTypeCatogrey() {
        List<GoodsTypeBean> list = new ArrayList<>();
        list.add(new GoodsTypeBean("保护壳", 1));
        list.add(new GoodsTypeBean("保护膜", 2));
        list.add(new GoodsTypeBean("耳机", 3));
        list.add(new GoodsTypeBean("数据线", 4));
        return list;
    }

    /**
     * 根据类别返回信息列表
     */
    public static List<GoodsPartsItemBean> getGoodsPartsByCategory(List<GoodsPartsItemBean> list, int categoryId) {
        List<GoodsPartsItemBean> tmp = new ArrayList<>();
        for (GoodsPartsItemBean item : list) {
            if (item.getCategoryId() == categoryId) {
                tmp.add(item);
            }
        }
        return tmp;
    }

    /**
     * @return 得到价格区间
     */
    public static List<SearchTypeBean> getPriceRange() {
        List<SearchTypeBean> priceRange = new ArrayList<>();
        priceRange.add(new SearchTypeBean("0-500", "" + 0, 1));
        priceRange.add(new SearchTypeBean("500-1000", "" + 1, 1));
        priceRange.add(new SearchTypeBean("1000-1500", "" + 2, 1));
        priceRange.add(new SearchTypeBean("1500-2000", "" + 3, 1));
        priceRange.add(new SearchTypeBean("2500-3000", "" + 4, 1));
        priceRange.add(new SearchTypeBean("3000-3500", "" + 5, 1));
        priceRange.add(new SearchTypeBean("3500-4500", "" + 6, 1));
        priceRange.add(new SearchTypeBean("4500以上", "" + 7, 1));
        return priceRange;

    }

    /**
     * @return 得到内存区间
     */
    public static List<SearchTypeBean> getRamRange() {
        List<SearchTypeBean> ramRange = new ArrayList<>();
        ramRange.add(new SearchTypeBean("256MB", "" + 0, 1));
        ramRange.add(new SearchTypeBean("512MB", "" + 1, 1));
        ramRange.add(new SearchTypeBean("768MB", "" + 2, 1));
        ramRange.add(new SearchTypeBean("125MB", "" + 6, 1));
        ramRange.add(new SearchTypeBean("1GB", "" + 3, 1));
        ramRange.add(new SearchTypeBean("2GB", "" + 4, 1));
        ramRange.add(new SearchTypeBean("3GB", "" + 5, 1));
        ramRange.add(new SearchTypeBean("4GB", "" + 7, 1));
        ramRange.add(new SearchTypeBean("5GB", "" + 9, 1));
        ramRange.add(new SearchTypeBean("6GB", "" + 8, 1));
        ramRange.add(new SearchTypeBean("不设置", "" + 10, 1));
        return ramRange;

    }
}
